cd "$replication\code\"

set matsize 5000

****************************************************************************** Input variables ************************************************************
global cluster "sd_code"
global AS_infs `""""'
global AS_var "NA"
global sample "year!=."
global controls ""
global controlsXYFEs ""
global controlsXinfs ""
global omitted_year1=-1
global omitted_year2=-6
global min_year=-6
global max_year=5
global colour="no_graphs"
global depvar "icw_irrigation"

global int "elecXroad"
local inf1=substr("${int}",1,4)
local inf2=substr("${int}",6,.)
global  infs "`inf1' `inf2' ${int}"
global absorb "shrid_code i.s_code#i.year"


**** Column 1
global title "R + E \\ het by \\ state"
global AS_infs `""road","elec""'
global AS_var "s_code"
qui : do Z_Event_code.do
qui estimates restore main_regression
foreach inf in $infs {
	lincom ${post_terms_`inf'}
}

**** Column 2
global title "R + E \\ het by \\ year"
global AS_infs `""road","elec""'
global AS_var "year"
qui: do Z_Event_code.do
qui estimates restore main_regression
foreach inf in $infs {
	lincom ${post_terms_`inf'}
}

**** Column 3
global title "Controls \\ by year \\ FEs"

global AS_infs `""""'
global AS_var "N/A"
global controlsXYFEs "pc01_vd_p_sch_d pc01_vd_m_sch_d pc01_vd_s_sch_d pc01_vd_s_s_sch_d pc01_vd_college_d ln_pc01_pca_no_hh ln_pc01_pca_tot_p pc01_pca_p_sc_share pc01_pca_p_st_share pc01_pca_p_lit_share pc01_vd_power_agr pc01_vd_power_dom pc01_vd_power_all pc01_vd_dirt_road pc01_vd_tar_road ln_pc01_vd_area  ln_tdist_10 ln_tdist_50 ln_tdist_100 ln_tdist_500 tot_irr_share_2001  h_cntr_1_2001_d ph_cntr_1_2001_d drnk_wat_f_1_2001_d post_off_1_2001_d phone_1_2001_d"
global controls ""
qui: do Z_Event_code.do
qui estimates restore main_regression
foreach inf in $infs {
	lincom ${post_terms_`inf'}
}

*** Colmun 4
global title "Political \\ controls"
global absorb "shrid_code i.s_code#i.year i.years_since_elc#i.party_code i.years_since_elc#coalition"
global controlsXYFEs ""
global controls "coalition"
qui: do Z_Event_code.do
qui estimates restore main_regression
foreach inf in $infs {
	lincom ${post_terms_`inf'}
}



*** Column 5
global title "Only \\ districts \\ without \\ conflict"
global absorb "shrid_code i.s_code#i.year"
global sample "conflict_district==0"
global controls ""
qui: do Z_Event_code.do
qui estimates restore main_regression
foreach inf in $infs {
	lincom ${post_terms_`inf'}
}


*** Column 6 
global title "Using \\ planned \\ road \\ date"
global sample "year!=."
global int "elecXroadP"
qui: do Z_Event_code.do
qui estimates restore main_regression
foreach inf in $infs {
	lincom ${post_terms_`inf'}
}


*** Column 7
global title "District \\ by year \\ FEs"
global int "elecXroad"
global absorb "shrid_code i.d_code#i.year "
qui: do Z_Event_code.do
qui estimates restore main_regression
foreach inf in $infs {
	lincom ${post_terms_`inf'}
}


*** Column 8
global title "District \\ clustered \\ standard \\ errors"
global absorb "shrid_code i.s_code#i.year"
global cluster "d_code"
qui: do Z_Event_code.do
qui estimates restore main_regression
foreach inf in $infs {
	lincom ${post_terms_`inf'}
}

*** Column 9
global title "Spatially \\ clustered \\ standard \\ errors"
global cluster "spatial"
qui: do Z_Event_code.do
qui estimates restore main_regression
foreach inf in $infs {
	lincom ${post_terms_`inf'}
}
